/**
 * Created in 2012-2-28.
 */
package com.surekam.mnai.model;

import java.io.Serializable;
import java.util.Date;

/**
 * 手机号归属信息类型。
 * 
 * @author 吴政
 * 
 */
public class MobileNumberAttribution implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 手机号码段。通常是手机号前七位数。
	 */
	private String mobileNumberSegment;

	/**
	 * 手机卡类型。
	 */
	private String phoneCardType;

	/**
	 * 归属地址。
	 */
	private Address address;
	
	/**
	 * 最后更新时间。
	 */
	private Date lastUpdatedTime;

	public MobileNumberAttribution() {

	}

	public MobileNumberAttribution(String mobileNumberSegment,
			String phoneCardType, Address address, Date lastUpdatedTime) {
		this.mobileNumberSegment = mobileNumberSegment;
		this.phoneCardType = phoneCardType;
		this.address = address;
		this.lastUpdatedTime = lastUpdatedTime;
	}

	public String getMobileNumberSegment() {
		return mobileNumberSegment;
	}

	public void setMobileNumberSegment(String mobileNumberSegment) {
		this.mobileNumberSegment = mobileNumberSegment;
	}

	public String getPhoneCardType() {
		return phoneCardType;
	}

	public void setPhoneCardType(String phoneCardType) {
		this.phoneCardType = phoneCardType;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public Date getLastUpdatedTime() {
		return lastUpdatedTime;
	}

	public void setLastUpdatedTime(Date lastUpdatedTime) {
		this.lastUpdatedTime = lastUpdatedTime;
	}

	@Override
	public int hashCode() {
		int code = 17;

		code = code * 17 + mobileNumberSegment.hashCode();
		code = code * 17 + phoneCardType.hashCode();
		code = code * 17 + address.hashCode();

		return code;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == this) {
			return true;
		}

		if (obj instanceof MobileNumberAttribution) {
			MobileNumberAttribution other = (MobileNumberAttribution) obj;

			if (this.mobileNumberSegment.equals(other.mobileNumberSegment)) {
				return true;
			}
		}

		return false;
	}

}
